package router

import (
	beego "github.com/beego/beego/v2/server/web"
	web "ksd-social-api/modules/user/controller"
)

type UserRouter struct {
}

/**
 * @author feige
 * @date 2023-10-14
 * @version 1.0
 * @desc 无需登录
 */
func (router *UserRouter) InitNoLoginRouter() beego.LinkNamespace {
	// 用户中心--子命名空间
	namespace := beego.NSNamespace("/user",
		// 根据用户id查询用户明细
		beego.NSCtrlPost("/getUserInfo", (*web.UserController).GetUserInfo),
		beego.NSCtrlPost("/teacher/list", (*web.UserController).FindUserTeachers),
		beego.NSCtrlPost("/state/info", (*web.UserController).FindUserReg),
		beego.NSCtrlPost("/zone/info", (*web.UserCenterZoneController).GetUserInfoByUuid),
	)
	return namespace
}

/**
 * @author feige
 * @date 2023-10-14
 * @version 1.0
 * @desc 需要登录 --- 用户个人信息
 */
func (router *UserRouter) InitRouter() beego.LinkNamespace {
	namespace := beego.NSNamespace("/user",
		beego.NSCtrlPost("/getUserInfo", (*web.UserController).GetUserInfo),
		beego.NSCtrlPost("/getIsLoginUserInfo", (*web.UserController).GetIsLoginUserInfo),
		beego.NSCtrlPost("/getUserBankInfo", (*web.UserController).GetUserBankInfo),
		beego.NSCtrlPost("/getOnlineUsers", (*web.UserController).GetOnlineUsers),
		// 修改个人密码
		beego.NSCtrlPost("/updatePwd", (*web.UserController).UpdateUserPwd),
		// 绑定用户手机
		beego.NSCtrlPost("/bind/userPhone", (*web.UserController).UserBindPhone),
		// 修改个人资料
		beego.NSCtrlPost("/update/userInfo", (*web.UserController).UpdateUserInfo),
		// 收益设置
		beego.NSCtrlPost("/update/password", (*web.UserCenterController).UpdateUserPassword),
		// 申请作者
		beego.NSCtrlPost("/update/author", (*web.UserCenterController).UpdateUserAuthor),
		// 修改密码
		beego.NSCtrlPost("/update/bank", (*web.UserCenterController).UpdateUserBank),

		// 关注和取消和在关注
		beego.NSCtrlPost("/focus/savecancel", (*web.UserFocusController).SaveCancelUserFocus),
		// 取消关注
		beego.NSCtrlPost("/focus/cancle", (*web.UserFocusController).CancelUserFocus),
		// 删除关注
		beego.NSCtrlPost("/focus/delgz", (*web.UserFocusController).DelUserFocus),
		// 删除粉丝
		beego.NSCtrlPost("/focus/delfans", (*web.UserFocusController).CancelUserFansFocus),
		// 用户粉丝列表
		beego.NSCtrlPost("/focus/fans", (*web.UserCenterController).FindUserFocusPage),
		// 用户关注列表
		beego.NSCtrlPost("/focus/gz", (*web.UserCenterController).FindUserFocusGzPage),

		// 用户身份兑换
		beego.NSCtrlPost("/code/vip/dh", (*web.UserVipCodeController).DuihuanUserVIP),
		// 用户身份信息查找
		beego.NSCtrlPost("/code/vip/query", (*web.UserVipCodeController).QueryInfoByCode),

		// 用户充值
		beego.NSCtrlPost("/code/wallet/dh", (*web.UserWalletCodeController).DuihuanUserWallet),
		// 用户充值兑换码生成
		beego.NSCtrlPost("/code/wallet/create", (*web.UserWalletCodeController).SaveUserWalletCode),

		// 用户中心 --我的小册
		beego.NSCtrlPost("/center/note/list", (*web.UserCenterController).FindMyNotePage),
		// 足迹小册
		beego.NSCtrlPost("/center/note/broswer", (*web.UserCenterController).FindMyNotesBroswerPage),
		// 收藏小册
		beego.NSCtrlPost("/center/note/fav", (*web.UserCenterController).FindNoteUserFavPage),
		// 点赞小册
		beego.NSCtrlPost("/center/note/like", (*web.UserCenterController).FindNoteUserLikePage),
		// 删除浏览记录小册
		beego.NSCtrlPost("/center/note/remove/broswer", (*web.UserCenterController).RemoveNoteHits),
		// 取消点赞小册
		beego.NSCtrlPost("/center/note/cancel/like", (*web.UserCenterController).CanceLikeNote),
		// 取消收藏小册
		beego.NSCtrlPost("/center/note/cancel/fav", (*web.UserCenterController).CancelFavNote),

		// 用户中心 --我的专题
		beego.NSCtrlPost("/center/special/list", (*web.UserCenterController).FindMySpecialPage),
		// 足迹专题
		beego.NSCtrlPost("/center/special/broswer", (*web.UserCenterController).FindMySpecialsBroswerPage),
		// 收藏专题
		beego.NSCtrlPost("/center/special/fav", (*web.UserCenterController).FindSpecialUserFavPage),
		// 点赞专题
		beego.NSCtrlPost("/center/special/like", (*web.UserCenterController).FindSpecialUserLikePage),
		// 删除浏览记录专题
		beego.NSCtrlPost("/center/special/remove/broswer", (*web.UserCenterController).RemoveSpecialHits),
		// 取消点赞专题
		beego.NSCtrlPost("/center/special/cancel/like", (*web.UserCenterController).CanceLikeSpecial),
		// 取消收藏专题
		beego.NSCtrlPost("/center/special/cancel/fav", (*web.UserCenterController).CancelFavSpecial),

		// 用户中心 -- 用户充值
		beego.NSCtrlPost("/center/wallet/records", (*web.UserCenterController).FindUserWalletRecords),
		// 用户基本资料修改
		beego.NSCtrlPost("/center/update/settings", (*web.UserCenterController).UpdateUserSetting),
		// 修改账号
		beego.NSCtrlPost("/center/update/settings/account", (*web.UserCenterController).UpdateUserSettingAccount),
		// 修改手机
		beego.NSCtrlPost("/center/update/settings/telephone", (*web.UserCenterController).UpdateUserSettingTelephone),

		// 我的消息
		beego.NSCtrlPost("/center/message/me", (*web.UserCenterController).FindUserMeMessageRecords),
		// 一键已读
		beego.NSCtrlPost("/center/message/markall", (*web.UserCenterController).UpdateMessageMeMarkByUserId),
		// 已读
		beego.NSCtrlPost("/center/message/mark", (*web.UserCenterController).UpdateMessageMeMarkById),
		// 删除
		beego.NSCtrlPost("/center/message/del", (*web.UserCenterController).DelMessageMeById),
		// 系统消息
		beego.NSCtrlPost("/center/message/system", (*web.UserCenterController).FindUserSystemMessageRecords),
		// 统计消息-我的消息和系统消息
		beego.NSCtrlPost("/relation/countmsg", (*web.UserController).CountMessage),
		beego.NSCtrlPost("/relation/countmsgall", (*web.UserController).CountMessageAll),

		// 会员订单
		beego.NSCtrlPost("/order/note", (*web.UserCenterController).FindMyNotesOrderPage),
		beego.NSCtrlPost("/order/special", (*web.UserCenterController).FindMySpecialsOrderPage),
		beego.NSCtrlPost("/order/special/bind", (*web.UserCenterController).FindMySpecialBindsOrderPage),
		beego.NSCtrlPost("/order/vip", (*web.UserCenterController).FindMyUserBuyVipOrderPage),

		// 首页数据总览和统计分析
		beego.NSCtrlPost("/center/user/state", (*web.UserCenterController).CountUserRelationState),
		beego.NSCtrlPost("/center/user/statemodal", (*web.UserCenterController).CountUserModelState),

		// 查询vip列表
		beego.NSCtrlPost("/uservip/list", (*web.UserVipController).FindUserVipCardList),
		// 申请作者
		beego.NSCtrlPost("/apply/author", (*web.UserController).ApplyAuthor),
	)
	return namespace
}

/**
 * @author feige
 * @date 2023-10-14
 * @version 1.0
 * @desc 需要登录
 */
func (router *UserRouter) InitAdminRouter() beego.LinkNamespace {
	namespace := beego.NSNamespace("/adminuser",
		// 查询用户明细
		beego.NSCtrlPost("/get/:id", (*web.AdminUserController).GetUserById),
		// 修改个人密码
		beego.NSCtrlPost("/update/password", (*web.AdminUserController).UpdatePwd),
		// 修改个人密码
		beego.NSCtrlPost("/update/telephone", (*web.AdminUserController).UpdateTelephone),
		// 用户列表
		beego.NSCtrlPost("/list", (*web.AdminUserController).FindUsers),
		// 用户注册
		beego.NSCtrlPost("/reg", (*web.AdminUserController).Reg),
		// 保存和修改
		beego.NSCtrlPost("/saveupdate", (*web.AdminUserController).SaveUpdateUser),
		// 赠送VIP
		beego.NSCtrlPost("/sendvip", (*web.AdminUserController).SaveUserBuyVip),
		// 修改状态
		beego.NSCtrlPost("/update/status", (*web.AdminUserController).UpdateFieldById),
		// 保存兑换码
		beego.NSCtrlPost("/code/saveupdate", (*web.AdminUserController).SaveUpdateCodes),
		// 查看兑换码
		beego.NSCtrlPost("/code/list", (*web.AdminUserController).FindCodes),
		// 修改兑换码
		beego.NSCtrlPost("/code/update/status", (*web.AdminUserController).UpdateFieldByCodeId),
		// 删除兑换码
		beego.NSCtrlPost("/code/del/:id", (*web.AdminUserController).DelCodeById),
		// 删除
		beego.NSCtrlPost("/del/:id", (*web.AdminUserController).DelById),
	)
	return namespace
}
